﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaseData.Exts;
using BaseData.Lib;
using BaseLib.Helper;

namespace BaseData.ModelsPlex.CMS
{
    public interface IR_Node<T> : IRepository<T> where T : class
    {
        #region - Get_ParentNode -

        T Get_ParentNode(int parentID, int flagStatus = 0);

        #endregion

        #region - 获取分类下的信息数量 -

        /// <summary>
        /// 获取分类下的信息数量
        /// </summary>
        /// <param name="nodeID">分类ID</param>
        /// <param name="flagStatus">标记</param>
        /// <returns></returns>
        int Get_Info_Count(int nodeID, int flagStatus = 0);

        #endregion

        #region - 判断是否还有子节点 -

        /// <summary>
        /// 判断是否还有子节点
        /// </summary>
        /// <param name="parentID">父记录ID</param>
        /// <param name="flagStatus">标记</param>
        /// <returns></returns>
        bool IsExistChild(int parentID, int flagStatus = 0);

        #endregion

        #region - 获取SortID -

        /// <summary>
        /// 获取SortID
        /// </summary>
        /// <param name="parentID">父节点ID</param>
        /// <returns></returns>
        int GetSortID(int parentID);

        #endregion

        #region - 获取深度值 -

        /// <summary>
        /// 获取LevelID
        /// </summary>
        /// <param name="parentID">父节点ID</param>
        /// <returns></returns>
        int GetLevelID(int parentID);

        #endregion

        #region - Get_PageListExt -

        PagerList<T> Get_PageListExt(int pageIndex, int pageSize, int siteID, EnumsCMS.Table Table, int parentID);

        PagerList<T> Get_PageListExt(int pageIndex, int pageSize, int siteID, EnumsCMS.Table Table);

        #endregion

        #region 获取在  X_CMS_Info 中没有记录的 X_CMS_Node列表

        /// <summary>
        /// 获取在  X_CMS_Info 中没有记录的 X_CMS_Node列表
        /// </summary>
        /// <param name="siteID">网站ID</param>
        /// <param name="modelID">模块ID</param>
        /// <param name="parentID">父记录ID</param>
        /// <param name="flagStatus">标记</param>
        /// <returns></returns>
        IQueryable<T> Get_NodeList_ByIsNotInfo(int siteID, int modelID, int parentID, int flagStatus);

        #endregion

        #region 获取在  X_CMS_Info 中没有记录的 X_CMS_Node列表
        /// <summary>
        /// 获取在  X_CMS_Info 中没有记录的 X_CMS_Node列表
        /// </summary>
        /// <param name="wetSiteID">网站ID</param>
        /// <param name="modelID">模块ID</param>
        /// <param name="parentID">父记录ID</param>
        /// <param name="flagStatus">标记</param>
        /// <returns></returns>
        IQueryable<T> Get_NodeList_ByIsNotInfo(int parentID, int flagStatus);

        #endregion

        #region 获取指定内容表ID的 关联分类列表
        /// <summary>
        /// 获取指定内容表ID的 关联分类列表
        /// </summary>
        /// <param name="infoID">内容表ID</param>
        /// <param name="flagStatus">标记</param>
        /// <returns></returns>
        IQueryable<T> Get_NodeList_ByRelation(int infoID, int flagStatus);

        #endregion
    }
}
